<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>选择客户退款账户</title>
    <style type="text/css">
    </style>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>

<body class="iframeBody">
<div class="Wrapper">
    <div class="searchArea">
    </div>
    <div id="ligergrid1" class="sq-grid"></div>
</div>

<script type="text/javascript">
    var basePath = '<%=path%>';
    var cstId = "${cstId}";
    var paySchId = "${paySchId}";
    var grid = null;
    $(function () {
        grid = $("#ligergrid1").ligerGrid({
            url: basePath + '/settle/bank/loadCstBankData.do',
            method: 'get',
            parms: {cstId: cstId},
            columns: [
                {display: '开户银行', name: 'bkCdNm', width: 150, align: 'center'},
                {display: '开户机构', name: 'accOrgNm', width: 150, align: 'center'},
                {display: '开户名称', name: 'accNm', width: 150, align: 'center'},
                {display: '银行账号', name: 'accNo', width: 150, align: 'center'},
                {display: '账户类型', name: 'accTypCdNm', width: 100, align: 'center'},
                {display: '开户证件类型', name: 'certTypCdNm', width: 100, align: 'center'},
                {display: '证件号', name: 'certNo', width: 150, align: 'center'},
                {display: '开户行行号', name: 'bkNo', width: 150, align: 'center'}
            ],
            pageSize: 10,
            root: 'rows',
            record: 'total',
            hideLoadButton: true,
            width: '100%',
            height: '100%',
            heightDiff: 20,
            fixedCellHeight: false,
            rownumbers: true,
            allowUnSelectRow: true,
            isMultiSelect: false,
            checkbox: true,
            isSingleCheck: true
        });
        grid.setHeight(100);

        $("#pageloading").hide();

        frameElement.dialog.onOk = function () {
            var selectedRows = grid.getSelectedRows();
            if (selectedRows.length == 0) {
                $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_SELECT_MORE_ROW, SQ_type: "warning"});
                return;
            }
            //frameElement.dialog.disabledBtns();
            var _bId;
            for (var index in selectedRows) {
                _bId = selectedRows[index].id;
            }
            var wait_dialog;
            $.ajax({
                type: 'post',
                dataType: 'json',
                data: {bId: _bId, paySchId: paySchId},
                url: basePath + '/settle/bank/confirmRefundBank.do',
                beforeSend: function () {
                    wait_dialog = $.ligerDialog.SQalert({
                        content: LogUtils.LOG_CMM_DATA_LOADING,
                        SQ_type: "waitting"
                    });
                },
                success: function (msg) {
                    wait_dialog.close();
                    if (msg.success == 1) {
                        top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "success"});
                        parent.cstBankGrid_1.reload();
                        frameElement.dialog.close();
                    } else {
                        top.$.ligerDialog.SQalert({content: msg.info, SQ_showButtons: true, SQ_type: "error"});
                    }
                }
            });
        };
        frameElement.dialog.onCancel = function () {
            frameElement.dialog.hide();
        };

    });

</script>

</body>
</html>
